import { LocationTag } from '../constants';
import { current } from './current';
import { destination } from './destination';
import { origin } from './origin';

function default_icon() {
  return {
    path: `M8.33398 14.9997C8.33398 8.54967 13.5507 3.33301 20.0007 3.33301C26.4507 3.33301 31.6673 8.54967 31.6673 14.9997C31.6673 23.7497 20.0007 36.6663 20.0007 36.6663C20.0007 36.6663 8.33398 23.7497 8.33398 14.9997Z
	M24.8609 18.75L23.8817 17.7708L20.6942 20.9514V12.5H19.3053V20.9514L16.1178 17.7639L15.1387 18.75L19.9998 23.6111L24.8609 18.75Z`,
    strokeColor: '#444545',
    fillColor: '#FFFFFF',
    fillOpacity: 1,
    strokeWeight: 0,
    rotation: 0,
    scale: 1,
    anchor: new google.maps.Point(10, 25),
  };
}

function get_svg_icon(tag: string) {
  if (tag == LocationTag.Destination) {
    return destination();
  }

  if (tag == LocationTag.Origin) {
    return origin();
  }

  if (tag == LocationTag.Current) {
    return current();
  }

  return default_icon();
}

export { get_svg_icon };
